cmake_minimum_required(VERSION 3.6)
project(AStarVisualization)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    add_definitions(-DFULL)
endif()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s -Wall")

find_package(Qt5Widgets)

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)

#qt5_wrap_cpp(Ui_hdr_moc ${PROJECT_SOURCE_DIR}/widget.h)
qt5_wrap_ui(UI_MOC ${PROJECT_SOURCE_DIR}/widget.ui)

add_executable("AStarVisualization"
    main.cpp
    widget.cpp
    pathfinding.cpp
    square.cpp
    ${UI_MOC}
    )

target_link_libraries("AStarVisualization" Qt5::Widgets)
